$OpenBSD: patch-provider_libserver_ECSession_cpp,v 1.18 2016/08/12 08:09:05 robert Exp $
--- provider/libserver/ECSession.cpp.orig	Mon Jul 18 23:19:27 2016
+++ provider/libserver/ECSession.cpp	Mon Aug  8 09:18:50 2016
@@ -956,11 +956,20 @@ ECRESULT ECAuthSession::ValidateUserSocket(int socket,
 	uid_t uid;
 	char strbuf[1024];
 #ifdef SO_PEERCRED
+#ifndef __OpenBSD__
 	struct ucred cr;
+#else
+	struct sockpeercred cr;
+#endif
 	unsigned int cr_len;
 
+#ifndef __OpenBSD__
 	cr_len = sizeof(struct ucred);
 	if(getsockopt(socket, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) != 0 || cr_len != sizeof(struct ucred)) {
+#else
+	cr_len = sizeof(struct sockpeercred);
+	if(getsockopt(socket, SOL_SOCKET, SO_PEERCRED, &cr, &cr_len) != 0 || cr_len != sizeof(struct sockpeercred)) {
+#endif
 		er = ZARAFA_E_LOGON_FAILED;
 		goto exit;
 	}
